package com.example.mapp;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;

import com.example.entity.supervision.ElevatorUsedInspection;

/**
 * Created by douyx on 2018/03/26.
 */
@Mapper
public interface ElevatorUsedInspectionMapp {

	@Select(" select * from elevator_used_inspection where id = #{id} ")
	ElevatorUsedInspection query(String id) throws Exception;

	@Insert(" insert into elevator_used_inspection (validate_cert,record_sign,sign,alarm_device,"
			+ "signal_system_func,anti_clamp_protection,sudden_stop_switch,check_report," + "maint_rport,maint_record)"
			+ " value " + "(#{validateCert},#{recordSign},#{sign},#{alarmDevice},"
			+ "#{signalSystemFunc},#{antiClampProtection},#{suddenStopSwitch},"
			+ "#{checkReport},#{maintRport},#{maintRecord})")
	@SelectKey(statement = "select last_insert_id()", keyProperty = "id", keyColumn = "id", before = false, resultType = Long.class)
	public int add(ElevatorUsedInspection elevatorUsedInspection) throws Exception;
}
